﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DNA.Mvc.Community
{
    public interface IForumRepository:IRepository<Forum>
    {
        bool HasChildren(int id);

        //IEnumerable<Forum> GetGroups(int parentID=0);
        
        /// <summary>
        /// Gets children forums for specified forum id.
        /// </summary>
        /// <param name="parentID">Specified the forum id.</param>
        /// <returns>The sub forum collection of the specified forum id.</returns>
        IEnumerable<Forum> GetForums(int parentID = 0);

        /// <summary>
        /// Get the threads for specified forum id.
        /// </summary>
        /// <param name="forumID">Specified the forum id.</param>
        /// <param name="pageIndex">Speicifed the page index</param>
        /// <param name="pageSize">Specified the page size</param>
        /// <param name="totalRecords">Specified the return total records count</param>
        /// <returns>The thread colleciton.</returns>
        IEnumerable<Thread> GetThreads(int forumID,string sortby,SortingOrders order, int pageIndex, int pageSize, out int totalRecords);

        IEnumerable<Forum> GetModeratedForums(string userName);

        ///<summary>
        /// Move the forum / forum group to a new position.
        /// </summary>
        /// <param name="id">Specified the forum id to move.</param>
        /// <param name="parentID">Specified the parent id which the forum belongs to .</param>
        /// <param name="pos">Specified the position where the forum move to.</param>
        void Move(int parentID, int id, int pos);

        int GetTotalModeratedThreadsCount(int forumID);

        int GetTotalModeratedPostsCount(int forumID);
    }
}
